FROM centos:6.6

RUN yum install -y  tar which  openssh   openssh-clients  openssh-server  vim
RUN sed -i 's/UsePAM yes/UsePAM no/g' /etc/ssh/sshd_config && /etc/init.d/sshd start
RUN echo root:111111 |  chpasswd

COPY ./ssh_config     /etc/ssh/ssh_config
COPY ./init.sh 	  /root/
COPY ./jdk-7u79-linux-x64.rpm  /root/
RUN rpm -i /root/jdk-7u79-linux-x64.rpm && rm /root/jdk-7u79-linux-x64.rpm
ENV JAVA_HOME=/usr/java/jdk1.7.0_79
ENV PATH=$PATH:$JAVA_HOME/bin
RUN ssh-keygen -t dsa -P '' -f ~/.ssh/id_dsa
RUN cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
RUN chmod 0600  ~/.ssh/authorized_keys

ENTRYPOINT ["/root/init.sh"]
